import json
objs = json.load(open("results_format.json", "rt"))
from nltk.translate.bleu_score import corpus_bleu, sentence_bleu
ref = []
predicts = []
for obj in objs:
    predicts.append(obj["predict"][1:-1])
    print(obj["predict"][1:-1])
    ref.append([obj["gt"]])
print(corpus_bleu(ref,predicts))

